//
//  HomeSectionTrendLabel.m
//  yjw-winner
//
//  Created by 隆霁 on 2018/9/25.
//  Copyright © 2018年 Shanghai decade financial information service co., LTD. All rights reserved.
//

#import "HomeSectionTrendLabel.h"


@interface HomeSectionTrendLabel() {

}
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *buttons;
@property (nonatomic, strong) id model;
@property (nonatomic, strong) HomeSectionTrendLabelCallBackBlock block;
@end
@implementation HomeSectionTrendLabel
+ (HomeSectionTrendLabel *)headView {
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([HomeSectionTrendLabel class]) owner:self options:nil]lastObject];
}

- (void)refreshWith:(id)model CallBackBlock:(HomeSectionTrendLabelCallBackBlock)block {
    self.block = block;
    self.model = model;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    for (UIButton *button in self.buttons) {
        button.layer.masksToBounds = YES;
        button.layer.cornerRadius = 4.0f;
    }
}

- (IBAction)moreLabelsButtonClick:(UIButton *)sender {
    if (self.block) {
        self.block(nil);
    }
}

- (IBAction)buttonClick:(UIButton *)sender {
    if (self.block) {
        self.block(sender.titleLabel.text);
    }
}

@end
